#region Copyright (C) 2007 Jens Winter

//Copyright (C) 2007 Jens Winter

//This library is free software; you can redistribute it and/or
//modify it under the terms of the GNU Lesser General Public
//License as published by the Free Software Foundation; either
//version 2.1 of the License, or (at your option) any later version.

//This library is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//Lesser General Public License for more details.

//You should have received a copy of the GNU Lesser General Public
//License along with this library; if not, write to the Free Software
//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

#endregion

using System;
using MbUnit.Framework;

namespace Flynn.Core.Tests
{
    [TestFixture]
    public class UpdateFixture
    {
        [Test]
        public void Version_Should_Be_Initialized()
        {
            Update update = new Update("42");

            Assert.AreEqual("42", update.Version);
        }

        [ExpectedException(typeof(ArgumentOutOfRangeException), @"The version must be must not be empty.
Parameter name: version")]
        public void Version_Must_Not_Be_Empty(int invalidVersion)
        {
            new Update(string.Empty);
        }

        [Test]
        public void SqlStatements_Should_Be_Empty_On_New_Update()
        {
            Update update = new Update("42");

            Assert.IsNotNull(update.SqlStatements);
            Assert.AreEqual(0, update.SqlStatements.Count);
        }
    }
}